package com.csdn;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class GetFileName {

	private static String[] getFileName(String path) {
		File file = new File(path);
		String[] fileName = file.list();
		return fileName;
	}
	public static List<String> getRestErrorFile(){
		String path = "D:\\logs\\rest";
		List<String> fileName = new ArrayList<String>();
		for (String name : getFileName(path)) {
			if(name.contains("error")){
				fileName.add(path +"\\"+name);
			}
		}
		return fileName;
		
	}
	
	public static String unicode(String value){
		//String s = "生活随笔(7)";  
		StringBuffer sb = new StringBuffer();
	    char[] chars = value.toCharArray();  
	    for(int i = 0; i < chars.length; i ++) {  
	        if((chars[i] >= 19968 && chars[i] <= 40869) || (chars[i] >= 97 && chars[i] <= 122) || (chars[i] >= 65 && chars[i] <= 90)) {  
	            sb.append(chars[i]);
	        }  
	    }  
		return sb.toString();
	}

	public static void main(String[] args) {
		for (String name : getRestErrorFile()) {
			if(name.contains("error")){
				System.out.println(name);
			}
		}
		 

	}

}
